#template('colorThemeInit.vm')

/**
 * Raw (Wiki Syntax) Diff
 */

.diff-container {
  border: 1px solid $theme.borderColor;
  font-family: Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  overflow: auto;
}

.diff-container table {
  /* Prevent scroll bars when the table fills the entire width. */
  margin: 0;
  /* Having a table size of 100% leads to the display of an horizontal scroll bar when a td has a border. A 99.99% width
     is visually indistinguishable but prevents this overflow. */
  width: 99.99%
}

.diff-container td {
  border: 0 none;
  padding: 0 .5em;
}

td.diff-line-number {
  border-right: 1px solid $theme.borderColor;
  color: $theme.textSecondaryColor;
  text-align: center;
  vertical-align: middle;
}

td.diff-line {
  /* Take all the available space. */
  width: 100%;
  vertical-align: middle;
  /* Preserve code formatting and also wrap long lines that exceed the available width. */
  white-space: pre-wrap;
}

/* Prevent the code formatting for diff lines containing a decision form as it breaks the display of the form.
   The code formatting and long line wrapping is instead applied on the proposed decisions preview contained in the 
   line. */
td.diff-line.diff-line-decision {
  white-space: normal;
  padding: 0.5em;
}

td.diff-line.diff-line-decision span.diff-decision {
  /* Preserve code formatting and also wrap long lines that exceed the available width. */
  white-space: pre-wrap;
  width: 70%;
}

.diff-line-added {
  background-color: #DDFFDD;
  color: #000;
}

.diff-line-deleted {
  background-color: #FFDDDD;
  color: #000;
}

td.diff-line-meta {
  background-color: $theme.backgroundSecondaryColor;
  color: $theme.textSecondaryColor;
  padding: .8em .5em;
}

.diff-line del {
  background-color: #FFAAAA;
  text-decoration: none;
}

.diff-line ins {
  background-color: #AAFFAA;
  text-decoration: none;
}

.diff-conflict {
  background-color: #FFCF00;
}

.diff-conflict-resolution {
  background-color: #B8DEFF;
  border: 1px dashed;
}

span.diff-decision {
  display: inline-block;
}

textarea.diff-decision {
  width: 70%;
  display: inline-block;
}

/* Prevent displaying the maximize link */
.diff-line .fullScreenEditLinkContainer {
  display: none;
}

.empty-decision-value {
  color: red;
}

.diff-choices {
  float: right;
}

dt.diff-header {
  border-left: 5px solid $theme.borderColor;
  border-right: 1px solid $theme.borderColor;
  color: $theme.textSecondaryColor;
  font-weight: normal;
  margin: 0;
  padding: .5em .2em;
}

dt.diff-header:first-child,
dt.diff-header + dt.diff-header {
  border-top: 1px solid $theme.borderColor;
}

dt.diff-header:last-child {
  border-bottom: 1px solid $theme.borderColor;
}

dl.diff-group {
  margin-top: 1.5em;
}

dl.diff-group > dt {
  margin-bottom: 1em;
}

dl.diff-group > dt .hint {
  color: $theme.textSecondaryColor;
  font-weight: normal;
}

dl.diff-group > dd > dl {
  /* Overwrite the left margin from Colibri. */
  margin-left: 0;
}

.diff-icon-insert {
  color: #55A532;
}

.diff-icon-delete {
  color: #BD2C00;
}

.diff-icon-change {
  color: #D0B44C;
}

.diff-item-locale, .diff-item-hint {
  color: $theme.textSecondaryColor;
  font-size: 65%;
}

.diff-item-locale {
  vertical-align: middle;
}

.diff-item-hint {
  display: block;
  margin-top: .3em;
}

ul.diff-summary {
  padding-left: 0;
}

ul.diff-summary, .diff-summary ul {
  list-style: none;
}

.diff-summary-item {
  padding: .3em 0;
}

.diff-summary-item-hint {
  color: $theme.textSecondaryColor;
  font-size: 85%;
}

.diff-info-icon {
  cursor: default;
}

/**
 * Rendered Content (HTML) Diff
 */

.html-diff [data-xwiki-html-diff="deleted"] {
  background-color: #FFAAAA;
}
.html-diff [data-xwiki-html-diff="inserted"] {
  background-color: #AAFFAA;
}
/* Not all images have transparent background so using only the background color to mark deleted and inserted images is
  not enough. */
.html-diff img[data-xwiki-html-diff="deleted"] {
  border: 2px solid #FFAAAA;
}
.html-diff img[data-xwiki-html-diff="inserted"] {
  border: 2px solid #AAFFAA;
}
.html-diff [data-xwiki-html-diff-block="deleted"] {
  background-color: #FFDDDD;
}
.html-diff [data-xwiki-html-diff-block="inserted"] {
  background-color: #DDFFDD;
}
.html-diff [data-xwiki-html-diff-hidden="true"] {
  display: none;
}

.html-diff [data-xwiki-html-diff-hidden="ellipsis"] {
  height: 20px;
  visibility: hidden;
}
.html-diff [data-xwiki-html-diff-hidden="ellipsis"]:before {
  color: $theme.textSecondaryColor;
  content: '...';
  cursor: pointer;
  position: absolute;
  visibility: visible;
}
.html-diff [data-xwiki-html-diff-hidden="ellipsis"]:hover:before {
  color: $theme.linkColor;
}
